package file.gui;

import java.awt.ScrollPane;

import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;


public class GUI_ImagePanelTest extends JFrame {
	
	GUI_ImagePanelTest(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("test");
		setSize(800, 600);
		
		GUI_ImagePanel panel1 = new GUI_ImagePanel(new ImageIcon("001.jpg"),getWidth());
		GUI_ImagePanel panel2 = new GUI_ImagePanel(new ImageIcon("test.jpg"),getWidth());
		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
		panel.add(panel1);
		panel.add(panel2);
		JScrollPane scrollpanel = new JScrollPane(panel);
		scrollpanel.getVerticalScrollBar().setUnitIncrement(30);
		scrollpanel.getVerticalScrollBar().setBlockIncrement(30);
		scrollpanel.getHorizontalScrollBar().setBlockIncrement(30);
		scrollpanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		add(scrollpanel);
		
		setLocationRelativeTo(null);
		setVisible(true);
	}
	
	public static void main(String[] args) {
		new GUI_ImagePanelTest();
	}
}
